package com.yl.applicationsecurity.config;

import com.yl.applicationsecurity.service.AlarmRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;

/**
 * @author 鹤仙问鹿仙
 * @program: Application-security
 * @description: 定时任务
 * @date 2025-04-30 11:59:52
 */
@Component
public class ScheduledTasks {

    @Autowired
    private AlarmRecordService AlarmRecordService;






    //@Scheduled(cron = "0 10 17 * * ?")
    // 每天凌晨1点执行
    @Scheduled(cron = "0 0 1 * * ?")
    public void dailyTask() {
        System.out.println("执行每日任务=====================================");
        AlarmRecordService.getDataSgmSafeRiskToAlarmRecord(LocalDateTime.now());
    }


}

